<%@include file="_header.jspf" %>
<%@ page import="com.spartancoder.accommodation.models.AccommodationSession" %>
<%@ page import="com.spartancoder.accommodation.beans.AccommodationSessionBean" %>
<%@ page import="com.spartancoder.accommodation.models.AuthToken" %>
<%@ page import="com.spartancoder.accommodation.models.Options" %>
<%@ page import="com.spartancoder.accommodation.beans.OptionBean" %>
<%
AuthToken authToken = (AuthToken)request.getAttribute("authToken");
AccommodationSessionBean as = AccommodationSession.fetchActive();
%>

<h2>Listare optiuni <b><%=as.getName()%></b></h2>

<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>Camin</th>
            <th>Camera</th>
            <th>Comentariu</th>
            <th>Optiuni</th>
        </tr>
    </thead>
    <tbody>
    <% for(OptionBean ob : Options.fetchAll(as.getSessionId(), authToken.getId())) { %>
        <tr>
            <td><%=ob.getOptionId()%></td>
            <td><%=ob.getPlace().getName()%></td>
            <td><%=ob.getRoom()%></td>
            <td><%=ob.getComment()%></td>
            <td>
                <a href="remove-options.jsp?id=<%=ob.getOptionId()%>">
                    sterge
                </a>
            </td>
        </tr>
    <% } %>
    </tbody>
</table>

<%@include file="_footer.jspf" %>